class Person {
  //public name: string;
  // constructor(name: string) {
  //   this.name = name;
  // }

  constructor(public name: string) {}
}
const person = new Person("jspang");
console.log(person.name);

class Teacher extends Person {
  constructor(public age: number) {
    super("chj"); //派生类构造函数必须调用 super()
  }
}

const teacher = new Teacher(20);
console.log(teacher);
